package com.oa.gform.client.ui;

import java.util.Collection;
import java.util.Date;

import com.google.gwt.user.datepicker.client.DateBox;
import com.oa.gform.client.validator.GValidationCallback;
import com.oa.gform.client.validator.GValidator;

public class GFieldDateBox extends DateBox implements GField<Date> {
	GBaseFieldImpl<Date> baseFieldImpl = new GBaseFieldImpl<Date>(this);
	
	/***
	 * Costruttore di default
	 */
	public GFieldDateBox() {
		super();
	}
	
	public void setFieldName(String fieldName) {
		baseFieldImpl.setFieldName(fieldName);
	}

	public String getFieldName() {
		return baseFieldImpl.getFieldName();
	}
	
	public String[] getFieldGroupNames() {
		return baseFieldImpl.getFieldGroupNames();
	}

	public void setFieldGroupNames(String... fieldGroupNames) {
		baseFieldImpl.setFieldGroupNames(fieldGroupNames);
	}

	public boolean isInGroupName(String fieldGroupName) {
		return baseFieldImpl.isInGroupName(fieldGroupName);
	}

	public GFieldLabel getGFieldLabel() {
		return baseFieldImpl.getGFieldLabel();
	}

	public void setGFieldLabel(GFieldLabel gfieldLabel) {
		baseFieldImpl.setGFieldLabel(gfieldLabel);
	}

	public void addGValidator(GValidator validator) {
		baseFieldImpl.addGValidator(validator);
	}

	public void addGValidators(Collection<GValidator> collection) {
		baseFieldImpl.addGValidators(collection);
		
	}

	@Override
	public void setInError(boolean inError) {
		baseFieldImpl.setInError(inError);
	}

	@Override
	public void Validate(GValidationCallback gValidationCallback) {
		baseFieldImpl.Validate(gValidationCallback);
	}

	@Override
	public void reset() {
		baseFieldImpl.reset();
		setValue(null);
	}

	@Override
	public void setFieldValue(Date value) {
		setValue(value);
	}

	@Override
	public Date getFieldValue() {
		return getValue();
	}

}
